Typing Tools for Typeless Stack Languages
نویسنده
چکیده
Many low-level runtime engines and virtual machines are stack based instructions take parameters from the stack and leave their results on the stack. Stack language is a common name for several languages used to program stack based (virtual) machines like CLR, JVM, Forth, Postscript, etc. We chose the Forth language as an example to represent the class of stack languages, partially because this language is typeless, partially because there exists a big amount of industrial legacy Forth code that needs to be validated. Usually applications that take advantage of stack machines are minimalistic and designed to run on restricted environments like electronic devices, smartcards, embedded systems, etc. Sometimes these components are used to build safety critical systems where software errors are inadmissible. Type checking allows to locate possible errors of stack usage that most often occur in stack language programs. Limited resources give preference to a static solution run-time type information is expensive to manage and quite useless in turnkey applications. Static type checking is based on a type system that is introduced here for originally typeless stack languages. This external type system is flexible enough to perform several tasks. Static program analysis can be used both for finding errors and performing useful transformations on programs (optimization, parallelization, etc.). In this paper a type system to perform the so called must-analysis is described that allows to locate the stack language code where the strong stack discipline is violated. Experimental implementation of the analysis framework is written in Java.
منابع مشابه
BabyJ: from object based to class based programming via types
The popularity of object based languages has risen dramatically in recent years, owing to their use as scripts in HTML pages, or for interfacing with databases. A characteristic of these languages is interpretation and weak typing. Weak typing allows rapid prototyping but also runtime type errors. Therefore, it is desirable at a later development stage to have some assurances that your program ...
متن کاملTyping Functional Stack-Based Languages
Stack-based languages (e.g. Forth (Moore 1974), Postscript (Inc. 1999)) have been around for nearly four decades. They are particularly popular today for use as intermediate languages (e.g. CIL (ECMA 2002), JVML (Lindholm and Yellin 1999), (Morrisett et al. 1998)). This is for several reasons: they have good run-time performance characteristics, they resemble the machine level instructions on m...
متن کاملStack-Based Typed Assembly Language
In previous work, we presented a Typed Assembly Language (TAL). TAL is sufficiently expressive to serve as a target language for compilers of high-level languages such as ML. This work assumed such a compiler would perform a continuation-passing style transform and eliminate the control stack by heap-allocating activation records. However, most compilers are based on stack allocation. This pape...
متن کاملPractical and theoretical aspects of FORTH software development
This is an investigation into the use of the Forth programming environment. The main areas of enquiry were: interfacing Forth to other languages; interfacing Forth and local area networks; and the use of RISC processors with stack based architecture such as the NC4000 and Harris RTX series. We describe how t o i n terface Forth a n d C. W e also provide a system with a multi-tasking interrupt d...
متن کاملAdaptive Data Stores
Adaptive data is characterised by its ability to react to changes in the environment. Such data frequently occurs in Artificial Intelligence applications where the knowledge base may alter dynamically to adapt to new stimuli. Such systems are usually written in typeless, dynamically bound languages. Here we describe the concept of persistence and show how it may also be used in conjunction with...
متن کامل